<?php /* Smarty version 2.6.26, created on 2012-09-14 17:54:46
         compiled from mcost_tvsp_matter_export.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_options', 'mcost_tvsp_matter_export.html', 123, false),array('function', 'cycle', 'mcost_tvsp_matter_export.html', 165, false),array('modifier', 'date_format', 'mcost_tvsp_matter_export.html', 167, false),array('modifier', 'number_format', 'mcost_tvsp_matter_export.html', 170, false),)), $this); ?>
<?php echo '<?xml'; ?>
 version="1.0" encoding="utf-8"<?php echo '?>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		
		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
		
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/search.js"></script>
		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('#btn-export').click(function(){	
				if ( $("#electric_id").val() == "") {
					alert("電波圏を入力してください");
					return false;
				}
				if(confirm('ダウンロードしますか？')){
					document.fm.csv.value="download";
					document.fm.submit();
				}
			});
	
			$('#btn-reset').click(function(){	
				location.href = document.fm.action;
			});
			
			$('#btn_search').click(function(){	
				document.fm.csv.value="";
				document.fm.submit();
			});
			
			$('.text_date').datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy/mm/dd'
			});
			
			$('#year4').change(function(){
				var year4 = this.value;
				var myDate = new Date();
				var nowtime =  myDate.getTime();
				$.get("mmap_week_ajax.php",{ y: year4,t : nowtime }, function(data){
					$("#week_cd").children().remove();
					$("#week_cd").append( data ); 
				});
			});	
			$('#electric_id').change(function(){
				var val = this.value;
				var myDate = new Date();
				var nowtime =  myDate.getTime();
					
				$.get("ajax_cost_tvsp_mater.php",{ y: val,t : nowtime }, function(data){
					$("#mater_id").children().remove();
					$("#mater_id").append( data ); 
				});
			});
		});
		
		function toPage(thepage) {
			document.fm.page.value =  thepage;
			document.fm.csv.value="";
			document.fm.submit();
		}
		
		function setS( valcd, valnm ) {
			if (gPara == "shop") {
				document.fm.shop_cd.value = valcd;
				document.fm.shop_name.value = valnm;			
			}
			if (gPara == "mediaid") {
				document.fm.media_cd.value = valcd;
				document.fm.media_name.value = valnm;			
			} 
			$('#dialog').dialog("close");
		}
		</script>
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />
		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
	</head>
	<body id="">

<?php echo $this->_tpl_vars['menu']; ?>

<?php echo $this->_tpl_vars['logout']; ?>

		<div id="container"><div class="wrapper">
			<h2>TVSP経費マスター管理</h2>
			<ul class="submenu clearfix">
				<li><a href="mcost_tvsp_index.php">一覧.更新</a></li>
				<li><a href="mcost_tvsp_form.php">経費入力</a></li>
				<li><a href="mcost_tvsp_export.php">経費出力</a></li>
				<li><a href="mcost_tvsp_import.php">経費一括登録</a></li>
				<li><a href="mcost_tvsp_electric.php">電波圏マスタ</a></li>
				<?php if ($this->_tpl_vars['login']['staff_auth'] != 'G-9'): ?><li><a href="mcost_tvsp_mater.php">素材マスタ</a></li><?php endif; ?>
				<li>素材出力</li>
			</ul>
			<h3>経費出力</h3>
			<form name="fm" id="fm" method="get" action="mcost_tvsp_matter_export.php" >
				<input type="hidden" name="page" />
				<table class="formTable">
					<tbody><!--  
						<tr>
							<th>年月</th>
							<td>
								<?php echo smarty_function_html_options(array('id' => 'year4','name' => 'year4','options' => $this->_tpl_vars['year4'],'selected' => $this->_tpl_vars['forms']['year4']), $this);?>
 年  <?php echo smarty_function_html_options(array('id' => 'months','name' => 'months','options' => $this->_tpl_vars['months'],'selected' => $this->_tpl_vars['forms']['months']), $this);?>
 月
							</td>
						</tr>-->
						<tr>
							<th>※年</th>
							<td>
	<?php echo smarty_function_html_options(array('id' => 'year4','name' => 'year4','options' => $this->_tpl_vars['year4'],'selected' => $this->_tpl_vars['forms']['year4']), $this);?>
年
							</td>
						</tr><tr>
							<th>※電波圏</th>
							<td>
								<?php echo smarty_function_html_options(array('id' => 'electric_id','name' => 'electric_id','options' => $this->_tpl_vars['electrics'],'selected' => $this->_tpl_vars['forms']['electric_id']), $this);?>
<?php echo $this->_tpl_vars['err']['electric_id']; ?>

							</td>
						</tr>
					</tbody>
				</table>
				<p class="button">
					<button type="button" id="btn-export"  ><span>CSVダウンロード</span></button>
				</p>
				<input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
			</form>
<?php if (is_numeric ( $this->_tpl_vars['page']['cnt'] )): ?>
<?php if ($this->_tpl_vars['page']['cnt'] > 0): ?>
			<p class="message"><?php echo $this->_tpl_vars['page']['cnt']; ?>
件の情報が見つかりました。</p>
			<p align="left"><?php echo $this->_tpl_vars['pageing']; ?>
</p>
			<table id="search_result" class="sortable" >
				<thead>
					<tr>
						<th><h3>電波圏</h3></th>
						<th><h3>週名</h3></th>
						<th><h3>素材</h3></th>
						<th><h3>CM内容</h3></th>
						<th><h3>GRP</h3></th>
						<th><h3>経費</h3></th>
						<th><h3>更新</h3></th>
					</tr>
				</thead>
				<tbody>

<?php echo $this->_tpl_vars['nowindex']; ?>

<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['member'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['member']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
        $this->_foreach['member']['iteration']++;
?>
					<tr class="<?php echo smarty_function_cycle(array('values' => "odd,mod",'name' => 'member'), $this);?>
">
						<td><?php echo $this->_tpl_vars['electrics'][$this->_tpl_vars['v']['electric_id']]; ?>
</td>
						<td><?php echo $this->_tpl_vars['v']['week_cd']; ?>
週 (<?php echo ((is_array($_tmp=$this->_tpl_vars['v']['sent_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%m/%d") : smarty_modifier_date_format($_tmp, "%m/%d")); ?>
)</td>
						<td><?php echo $this->_tpl_vars['v']['mater_name']; ?>
</td>
						<td><?php echo $this->_tpl_vars['v']['cm_memo']; ?>
</td>
						<td align=right><?php echo ((is_array($_tmp=$this->_tpl_vars['v']['grp'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
</td>
						<td align=right><?php echo ((is_array($_tmp=$this->_tpl_vars['v']['cosrt'])) ? $this->_run_mod_handler('number_format', true, $_tmp) : number_format($_tmp)); ?>
</td>
						<td class="center"><a href="mcost_tvsp_form.php?id=<?php echo $this->_tpl_vars['v']['id']; ?>
">[更新]</a></td>

					</tr>
<?php endforeach; endif; unset($_from); ?>
				</tbody>
			</table>
			<p align="right"><?php echo $this->_tpl_vars['pageing']; ?>
</p>
			<!--  

			-->

<?php endif; ?>
<?php endif; ?>
<div id="dialog" >
</div>
		</div></div>
		<?php echo $this->_tpl_vars['footer']; ?>

	</body>
</html>